package ro.gateway.aida.fnd;

import ro.gateway.aida.obj.AIDAActivityObject;
import ro.gateway.aida.obj.GenericActivityProperty;



/**
 * <p>Title: Romanian AIDA</p>
 * <p>Description: :D application</p>
 * <p>Copyright: Copyright (comparator) 2003</p>
 * <p>Company: Romania Development Gateway </p>
 * @author Mihai Popoaei, mihai_popoaei@yahoo.com, smike@intellisource.ro
 * @version 1.0-* @version $Id: FundingYearlyItem.java,v 1.1 2004/10/24 23:37:14 mihaipostelnicu Exp $
 */
public class FundingYearlyItem extends AIDAActivityObject
{
      private long funding_id = -1;
      private GenericActivityProperty component;
      private long start_date = -1;
      private long amount = 0;
      private String currency;

      public FundingYearlyItem()
      {
            this.objectType = AIDAActivityObject.TYPE_FUNDING_YEARLY;
      }

      public boolean equals( FundingYearlyItem item )
      {
            return ( funding_id == item.funding_id )
                  && ( getComponent_id() == item.getComponent_id() )
                  && ( start_date == item.start_date )
                  && ( amount == item.amount )
                  && ( ( currency == null ) || ( currency.equals( item.currency ) ) );
      }

      public void setCurrency( String currency )
      {
            this.currency = currency;
      }

      public void setAmount( long amount )
      {
            this.amount = amount;
      }

      public void setStart_date( long start_date )
      {
            this.start_date = start_date;
      }

      public void setComponent( GenericActivityProperty component )
      {
            this.component = component;
      }

      public void setFunding_id( long funding_id )
      {
            this.funding_id = funding_id;
      }

      public String getCurrency()
      {
            return currency;
      }

      public long getAmount()
      {
            return amount;
      }

      public long getStart_date()
      {
            return start_date;
      }

      public GenericActivityProperty getComponent()
      {
            return component;
      }

      public long getComponent_id()
      {
            return ( component != null ) ? component.getId() : -1;
      }

      public long getFunding_id()
      {
            return funding_id;
      }

      public boolean isValid()
      {
            return ( this.start_date != -1 )
                  && ( currency != null )
                  && ( amount > 0 );
      }
}
